Computer programs are commonly made up of a number of threads that are run within an operating system. Each thread typically has a priority within a range of priority levels. This enables the operating system to determine which threads should have greater priority when a number of different threads are asking to be executed at the same time. Operating systems, depending on their design, can have a large number of different priority levels. For example, some operating systems may have only eight priority levels, while others may have 256 priority levels.
Real-time operating systems are those that guarantee execution of instructions within some predetermined, worst-case time limit, or bound. Because of this bound, real-time operating systems desirably must be able to enqueue prioritized threads to and dequeue prioritized threads from a priority queue that tracks all the threads within a predetermined maximum worst case limit. This is difficult to accomplish for a real-time operating system that has a large number of priority levels, without affecting its predictable performance too greatly. For this and other reasons, there is a need for the present invention.